# Maintainer:  Christian Hesse <mail@eworm.de>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: kfgz <kfgz at interia dot pl>
# Contributor: pootzko <pootzko at gmail dot com>

pkgname=haveged
pkgver=1.9.4
pkgrel=3
pkgdesc='Entropy harvesting daemon using CPU timings'
arch=('x86_64')
url='https://github.com/jirka-h/haveged'
license=('GPL')
depends=('glibc')
validpgpkeys=('8F6B7293B03E5AC5762B65CE2E2F252B05CCA168') # Jirka Hladky <hladky.jiri@gmail.com>
source=("$pkgname-$pkgver.tar.gz::https://github.com/jirka-h/$pkgname/archive/$pkgver.tar.gz"
        "https://github.com/jirka-h/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.gz.asc"
        'haveged.service')
sha256sums=('c4959d3cb1fa6391d16a3aa1ba4d82cd3a0d497206ae4b87d638088c0664e5aa'
            'SKIP'
            '1e78d296ebb5f4d46108094997c51e3fccf475f54d637f20212a3aa3730ef847')

build() {
  cd $pkgname-$pkgver

  ./configure \
      --prefix=/usr \
      --bindir=/usr/bin \
      --sbindir=/usr/bin
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install

  install -D -m0644 "${srcdir}"/haveged.service "$pkgdir"/usr/lib/systemd/system/haveged.service
}
